Adding exceptions for error situations