fix to optimize new code