corrected logic to determine if we're in edit or create mode