Fix for the key check