restart run function
restart run function and add apperror