add finish and destroy function to callbacks engine