bug fixes after new code