fixed issue where it removes a character before brackets