fix dependencies & remove potential bugs