Add some logging, refine some scheduling

add fg/bg addListener