added some code to deal with username case (made it all lower)