Fixed bug in onActivityResult