updated functions for ui