Fixed code for API < 16