bug fixes after merge