its overwriting the data instead of writing it on new line