did some bug fixes