took care of NULL cases