Added code to avoid authentication to be proceeded two or more times