Added more backend logic