fix returning always returning ok, and formatting