refator bug handler and rename it