Fixing check for credentials