Window closing fixed when topAadpter is null (custom frame)