fix bugs in subscript