fix exec function