before simulation