Fixed code for missing attrs