Adding a nil check