fixed bug with wrong variable being used for bamDir