fixing problem g bug