move activity callback function to engine