separate get_pid function and more conveninet check interval