modify "checkin" function by selina