Checked for some null conditions