fixes an exception in getting stats