added instance variable and added code for dock method