fixed bug with closing brackets