add timeout; make script execute before redirect