fixed the error where assertions were getting inserted after the dereference