now works in most of the cases