fix error check in assembly