Implement js for timeout