fixes thanks to roberts feedback