Fixed key error

fixes #410