fixed issue with ability to compile agent. sp variable was causing some issues