fix parsing in correct order