Making it work in all cases