added error classes instead of raising strings