Sujit: added a constant and a null check