added password reset function and some fixes for avatar issues