fixed bug when username is not passed in URL