multiple bug fixed