correct logic placement