menu function update

update error handling,