added key generation to users controller