updated code to dart v.0.8.1.2