Changed assertion line for checking if method is undefined