updated code in users controller