updated to improve authentication