fixed timeout and removed dirty code