moved status to status function