validation to be applied only on non nil values
logging uncaught errors