Added logger for better debugging