write file to ajax every second