Password authentication half working