bug fixes, attachment stuff