Replaced the content of init function with var self = this;.