removed flush, added trycatch