Fixed bug that caused the project to throw error and added a sample as well