latest changes from dagon
solved merge issues