fix several issues