added more tests and hopefully fixed a bug in sender