Fixed bugs with dynamodb