fixed log method
add specs for key generator