fixed method call on nil