fix for panel when at right edge