update resoucre parser logic & fixed the tests