Attempt to fix undefined method error