fixing the residual still, it seems to be working properly now