bug fixing on undefined attributes