bug fixing from reviews