Use esc_attr() rather than htmlentities()