fixing helper functions