Separate optimize crop method in startup script, bug fixed.