modifying hash so that it does not only work with strings