Moved reply logic to proper place