added extra key check