added Timeout function
Merge pull request #17 from Ahmed-90/master

added timeout function