Fixed nil. Add logfile for check