avoid nil excecution