Catch erro and undefined values