Fixed goofy if null check in a better way