Remove log and fix conditional