Added param null checks