javascript override method in class