Fixing bug in origin window