addded brackets to try and fix errors