bug fix in cached surface, context