fixed helper functions