change keyfile loading process