added and fixed functions for user table