changed print warning to Exception to get traceback