some helper functions added