fixing the populate and keys scripts