Removed const. Added log printing.