return value and print from main handler