Fix undefined method error