fix bugs to run gp