added check around attributes