fixed doc/function and cleans timeout.js