fix bracket errors