Trying again to fix undefined attribute