some bug fixes..