corrected error when no attachment exists