fixed several issues