Added check for horizontal visibility and callbacks