move setting overlay in the callback