removed unnecessary nil check