Fix coding error defining a prototype function inside the constructor.