added nil guard