Add null checks for  all the params