fix callback being called twice on timeout