prepare script fix