fixed indentation and missing if...