using empty function instead of two condition in if cause
removed output in log and removed unused variable