Added avatar extraction and also fixed missing ending php tag