utility functions fixes