fix apply errors