added the ability to call a function from psAutoClose