fixed previous bugs (beta ver 4.0)