added timeout to resume function