move select marker function to controller