This check seems problematic (maybe use a constant?). Also, shouldn't this be checked at import time instead of in the credentials?