count() checks for errors and throws them