Andrey's fix