started to add functions for dialog