javascript if statements with brackets are notoriously dangerous. would put them in