Fixed the issue with 'userAuthenticated' function is being executed before 'signin' in invoked.