fix attachment init bug