fix broken api key generation