If the close method can accept the parameter object, then we can check if execute our logic in the close event.