checking capabilities at run time instead, based on suggestions from @nilium