moved send replies from main handler to callback