fix undefined method, const assignment warning