Create status function