solved several minor bugs