Modified way repository was working and added some test