updated some potential bugs