Added check for pending transactions [Fixes #1]