fixed a few bugs regarding agent profile