adds an if stetement to determine if user is an agent or user