revert to earlier code, shouldve worked fine