update attachement functionality