fixed empty val bug