still some bugs to fix