fix bracket problems