fixing undefined method error