fix issues 1, 3, 4