Converted to proper jQuery plugin
Fixed class name of undefined
Check that prop exists