semi fix to batch optomize