Made some changes to work with laravel 4.2