fixed the bugs related to magrittr