improved status function