added nil check just for bette readability