impliment functionality for admin and client