Fixed error-handling bug
Fixed error-handling bug