bug fixes for previous commits