some bugg fixes