fixed #1 (timply bug) and update relevant code