Added null conditions