added further null conditions for date