Moved command logging outside of conditional