Fixed bug in not recognizing attr change