updated version. made attr accesible