WsP: minor adjusting
Added null guard check