Check to make sure className is set first

Otherwise we might get 'undefined' as a class