working version + facebook login