Fixed window issues finally