rework invatation and registration process due to postgre migration