added pre checks