creating funcs and adding user-agent management