remove extra space in brackets