moved function inside caption