fixed bad output