move assertions before try