fixed an error from my previous fork..

Moved the check for the exclude class higher up to prevent errors