fix window related bugs and warn user when max window limit has been reached