fixed rendering bug problem by resizing window and changing offset