adds nil? method to weed out nil errors