moved login button attempts check to ccc.js and fixed a bug.