More secure way of null catching