fixed key file parsing