fix bug where only one backend type was getting used per file
add tests