more robust check for undefined JS variables
reduce rerender delay to 1.5s