Corrected the return type of the settAttribute function