exception checking
bugfix