Created models and fixed the fragment attachment bug