echo belongs inside if block