Fix missing script function to control the agent login