added ability to invoke function using post