fix indentation. or actually logic: mode handling after the sql query