checking out function