Added error checking to status function