added done condition