Move status check to the right place