In the near future, home service robots will enter our daily life and interact with people more and more frequently. In order to cope with the needs and habits of different users, an easy robot programming method is desirable. For some users, who are not familiar with programming, customizing the robot program deserves attention. This paper suggests a method to use Programming by Demonstration(PbD) to teach a robot through user demonstration of the trajectory and save the trajectory into a cloud database to facilitate future playback when needed. Through the cloud database, each robot shares previously recorded trajectories. However, in many cases a recorded trajectory may need to be modified to be customized for an individual user. In this paper, a method is proposed to facilitate the robot to return to the original trajectory as part of the retrieved trajectory is modified. Experimental results are presented by using two robots in the robotic cloud system. The first one is the prototype dual-Arm home service robot Aladdin developed in the lab. The second robot is a TM5 robot from Techman, which reproduced the learned trajectories remotely.