Program works great in different windows