bug fixes due to new API