fix bug: signal handler and amount logging

fix signal handler interface problem
fix gen script amount logging