Error in using prototype