Got your logic of CheckOut in form load and your check in after clicking on submit, but what happens in case if the user closes the page itself i mean close button of the browser then the file would be still check out and no one could fill the form out