fix undefined method error