Adding authentication checking.