The three io:format calls above appear to be debug messages you forgot to remove.