ugly err bug fixed