fixed todo merge
fixed type errors that were crashing ambd