helper functions for jquery