Changed gprs to function so when cancelling the whole thing cancels.