try spreading vinegar over the bars.. it worked with my guinea pigs, they used to keep me up all night banging on the bars but vinegar(as suggested in my book)worked really good. I'm not sure but I think it should work the same with hamsters.