fix undefined method default for nilclass