doing a null check before toLowerCase