fixing several issues