fixes some bug