add some code for authentication