Suicide in painted function