fix status being in the wrong function