| Income taxes (Details) - USD ($) | 3 Months Ended | 6 Months Ended | ||
|---|---|---|---|---|
| Jun. 30, 2015 | Jun. 30, 2014 | Jun. 30, 2015 | Jun. 30, 2014 | |
| Income Tax Disclosure [Abstract] | ||||
| Provision (benefit) for income taxes | $ (5,931,436) | $ 115,490 | $ (6,541,931) | $ 350,682 | 
| Effective income tax rate percent | 0.10% | 3.20% | (43.80%) | 9.40% | 
| Release of valuation allowance | $ 7,700,000 | $ 1,500,000 | ||
| X | ||||||||||
| 
- Definition Percentage of current income tax expense (benefit) and deferred income tax expense (benefit) pertaining to continuing operations. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 | 
| X | ||||||||||
| 
- References No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of current income tax expense (benefit) and deferred income tax expense (benefit) pertaining to continuing operations. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 | 
| X | ||||||||||
| 
- Definition Amount of increase (decrease) in the valuation allowance for a specified deferred tax asset. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 |