Replacing exception with return 'nil'