new code for checkin, work in progress, only in dev mode