fixed bug where ['s were getting appended instead of prepended