Added enter window callback function