Use global instead of $GLOBALS. Global, global, global..