replaced scan() with query to utilize user name