trying to fix attrerror