removed ugly null check