fixed bug in bridge and added debugging scripts