improve auth key check