an alternative solution for #4