bug fixes after merging