updated to work also on Android