fixed error in byuser method