Added error handeling in stat methods