fixed tonnes of bugs