Added logging to pre.py so it doesn't crash