Setting onerror as a property