avoid match null and undefined object