updated to work with custom user models