only calling render() when in focus