add nil check in abstract method