fixed an ugly bug