Fixed login issues and mysql form a issues