Resolved few errors in the js