added done flags to break