How to protect the form with a custom code?