Added init script
Added error code