added getbyusername function