Added a way to get the parent function for using it as a callback