fix incorrectly initialized variables in constructor