fixed bug with contrast flip