update swap interval function