Fixed AG script