added ['error'] checking
merging