use json library for writing result