Function may run duplicated. This is a temporary solution to avoid $print printing unexpected result. But adjusting run sequence is an important TODO for next.