Changed definition of get_my_pub_val function a little